<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>紫色鹭</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<div id="header_01_html">
    <iframe id="header_01" src="head_01.html" frameborder="0"></iframe>
</div>
<div id="head_search_html">
    <iframe id="head_search" src="head_search.html" frameborder="0"></iframe>
</div>
<div class="container store_banner clearfix">
    <div class="store_tab">
        <a mhref="store_info.html" class="store-info">基本信息</a>
        <a class="active" v-show="storeId!=false?true:false">轮播管理</a>
        <a mhref="store_product.html" class="product-admin">商品管理</a>
        <a mhref="store_manage.html" class="order-admin">订单管理</a>
        <a class="has_store store-enter">企业认证</a>
        <!--<a mhref="store_evaluate.html" class="evaluate-admin">评价管理</a>-->
    </div>
    <div class="right">

        <div class="box-list">
            <div><a class="storeadd-banner" href="store_banner-add.html">新增轮播</a></div>
            <div class="box" v-for="(item,index) in list" v-cloak>
                <div class="title">轮播图{{index+1}}</div>
                <div class="img"><img :src="imgBaseUrl + item.picUrl" alt=""></div>
                <div class="delete" @click="delBanner(item.id)">删除</div>
                <a class="delete" :href="addbanner + item.id">编辑</a>
            </div>
        </div>
    </div>
</div>
<div class="tabRight">
    <div class="first">
        <ul>
            <li><a target="_blank" class="icon_admin_white" title=""></a></li>
            <li>
                <a target="_blank" class="go-shopcard c-fff">
                    <i class="icon_shopcar_white"></i>
                    <p class="mt10">购<br>物<br>车</p>
                    <span class="car-num pos-Sty1">0</span>
                </a>
            </li>
            <li>
                <a target="_blank" class="icon_list_white mt10 go-myorder" title="订单"></a>
                <a target="_blank" class="icon_collect_white mt10 go-myhas" title="收藏"></a>
                <a target="_blank" class="icon_history_white mt10 go-record" title="记录"></a>
            </li>
        </ul>
    </div>
    <div class="second">
        <a target="_blank" class="icon_edit_white"></a>
        <a target="_blank" class="icon_top_white mt10"></a>
    </div>
</div>
<script src="../js/config.js"></script>

<script>


    var layer;
    //轮播渲染
    var app = new Vue({
        el:'.box-list',
        data:{
            imgBaseUrl: imgBaseUrl,
            list:[],
            addbanner:'store_banner-add.html?id=',
            type:localStorage.getItem('type'),
            storeId:localStorage.getItem('storeId')
        },
        mounted:function(){
            this.getBanner();
        },
        methods:{
            getBanner:function () {
                get_ajax("/sys/banner/getBannersByStore",{storeId:localStorage.getItem('storeId')},function (data) {
                    app.list = data
                    console.log(app.list);
                })
            },
            delBanner:function (e) {
                $.ajax({
                    url:baseUrl+'/sys/banner/del',
                    type:'post',
                    data:{
                        id:e,
                        Token:localStorage.getItem("Token")
                    },
                    success:function (data) {
                        if(data.code==0){
                            layer.msg(data.msg)
                            app.getBanner();
                        }else{
                            layer.msg(data.msg);
                        }

                    }
                })

            }
        }
    })


</script>
</body>
</html>